<%-- 
    Document   : index
    Created on : Nov 8, 2013, 8:12:46 AM
    Author     : Liem
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/struts-tags" prefix="s"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%>
<jsp:include page="header.jsp"/>
<jsp:include page="leftbar.jsp"/>

<c:if test="${empty sessionScope.USER}">
    <jsp:forward page="login.jsp"/>
</c:if>
<c:import url="WEB-INF/xml/userpage.xml" var="userpageXml"/>
<c:import url="WEB-INF/xml/page.xml" var="pageXml"/>
<div class="main-wrapper">
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <div class="primary-head">
                    <h3 class="page-header">Your Confession Pages List</h3>
                </div>
            </div>
        </div>
        <c:if test="${empty sessionScope.HASTOKEN}">
            <div class="row-fluid">
                <div class="span12">
                    <div class="alert alert-error">
                        <button type="button" class="close" onclick="">×</button>
                        <i class="icon-info-sign"></i>
                        Your account has not connect with facebook. Click <a href="getFBAccessToken.action">here</a>
                    </div>

                </div>
            </div>
        </c:if>
        <c:if test="${not empty param.error}">
            <div class="row-fluid">
                <div class="span12">
                    <div class="alert alert-error">
                        <button type="button" class="close" onclick="">×</button>
                        <i class="icon-info-sign"></i>
                        <c:out value="${param.error}"/>
                    </div>
                </div>
            </div>
        </c:if>
        <div class="row-fluid">
            <div class="span12">
                <div class="content-widgets">
                    <div class="widget-head blue clearfix">
                        <h3 class="pull-left">Pages List</h3>
                    </div>
                    <div class="widget-container">
                        <div>
                            <div class="clearfix list-search-bar">
                                <div class="pull-right">
                                    <a href="addPage.jsp" class="btn btn-info">New Page</a>
                                </div>
                            </div>
                            <div class="list-wrap">
                                    <c:import url="WEB-INF/xml/userpage.xml" var="userpageXml" charEncoding="UTF-8"/>
                                    <c:import url="WEB-INF/xsl/listPageByUser.xsl" var="xsl" charEncoding="UTF-8"/>
                                    <x:transform doc="${userpageXml}" xslt="${xsl}">
                                        <x:param name="username" value="${sessionScope.USER}"></x:param>
                                    </x:transform>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
<jsp:include page="footer.jsp"/>
